﻿
//Handles network connectivity changes
(function (messenger, navigation, target) {

    //Subscribe to Newtwork connection status change
    messenger.register(messenger.networkStatusChanged(), function (message) {
        if (!message.isInternetAvailable) {
            navigation.navigate(target.noConnectivity);
        } else {
            navigation.back();
        }
    });

})(MvvmStack.Messenger, MvvmStack.Navigation, Demo.Navigation.target)